var hlCodeConvert = (function() {
    // 费项模块
    // 费项种类 --->  一次性费项、周期性费项
    function costType(state) {
        var result;
        switch (state) {
            case 'O':
                result = '一次性费项'
                break;
            case 'P':
                result = '周期性费项'
                break;
            case 'T':
                result = '临时性费项'
                break;
            case 'R':
                result = '租金'
                break;
            case '一次性费项':
                result = 'O'
                break;
            case '周期性费项':
                result = 'P'
                break;
            case '临时性费项':
                result = 'T'
                break;
            case '租金':
                result = 'R'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 合同模块
    // 合同类型 --->  ER 整租合同、WR 工位合同
    function contractType(state) {
        var result;
        switch (state) {
            case 'ER':
                result = '整租合同'
                break;
            case 'WR':
                result = '工位合同'
                break;
            case '整租合同':
                result = 'ER'
                break;
            case '工位合同':
                result = 'WR'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 租赁方类型 --->  ER 整租合同、WR 工位合同
    function contractZlfType(state) {
        var result;
        switch (state) {
            case 'C':
                result = '公司租户'
                break;
            case 'P':
                result = '个人租户'
                break;
            case '公司租户':
                result = 'C'
                break;
            case '个人租户':
                result = 'P'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 押付方式 --->  押金、保证金
    function depositType(state) {
        var result;
        switch (state) {
            case 'YJ':
                result = '押金'
                break;
            case 'BJ':
                result = '保证金'
                break;
            case '押金':
                result = 'YJ'
                break;
            case '保证金':
                result = 'BJ'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 合同审核状态 ---> 草稿、待审核、已审核 、审核拒绝 、执行中 、已到期 、已作废
    function contractAuditState(state) {
        var result;
        switch (state) {
            case 'CG':
                result = '草稿'
                break;
            case 'WA':
                result = '审批中'
                break;
            case 'PA':
                result = '已审核'
                break;
            case 'RJ':
                result = '审核拒绝'
                break;
            case 'EX':
                result = '执行中'
                break;
            case 'FN':
                result = '已到期'
                break;
            case 'GC':
                result = '已作废'
                break;
            case 'EN':
                result = '已结束'
                break;
            case 'TE':
                result = '已终止'
                break;
            case '草稿':
                result = 'CG'
                break;
            case '审批中':
                result = 'WA'
                break;
            case '已审核':
                result = 'PA'
                break;
            case '审核拒绝':
                result = 'RJ'
                break;
            case '执行中':
                result = 'EX'
                break;
            case '已到期':
                result = 'FN'
                break;
            case '已作废':
                result = 'GC'
                break;
            case '已结束':
                result = 'EN'
                break;
            default:
                result = ''
        }
        return result;
    }
    // 退租合同审核状态 ---> 草稿 、 待业务审核 、业务审核通过 、 业务审核不通过 、待财务审核 、财务审核通过 、财务审核失败 、已作废 、待结算、已完成
    function withdrawAuditState(state) {
        var result;
        switch (state) {
            case 'CG':
                result = '草稿'
                break;
            case 'WBP':
                result = '审批中'
                break;
            case 'SBP':
                result = '审批中'
                break;
            case 'FBP':
                result = '审批拒绝'
                break;
            case 'WCP':
                result = '审批中'
                break;
            case 'SCP':
                result = '审批通过'
                break;
            case 'FCP':
                result = '审批拒绝'
                break;
            case 'ZF':
                result = '已作废'
                break;
            case 'WJS':
                result = '待结算'
                break;
            case 'FN':
                result = '已完成'
                break;
            case '草稿':
                result = 'CG'
                break;
            case '审批中':
                result = 'WBP'
                break;
            case '审批中':
                result = 'SBP'
                break;
            case '审批拒绝':
                result = 'FBP'
                break;
            case '审批中':
                result = 'WCP'
                break;
            case '审批通过':
                result = 'SCP'
                break;
            case '已作废':
                result = 'ZF'
                break;
            case '待结算':
                result = 'WJS'
                break;
            case '已完成':
                result = 'FN'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 产业类型  ----> 制造业、能源矿业、建筑/房地产、环保/公共设施、科研/技术服务、农业、医药/医疗/保健
    // ----> 贸易/运输/物流、金融/投资、零售/消费品、教育/培训、文化/体育/娱乐、IT/通讯/网络、专业及商务服务、政府/社会组织、其他
    function industryType(state) {
        var result;
        switch (state) {
            case 'MI':
                result = '制造业'
                break;
            case 'JZ':
                result = '能源矿业'
                break;
            case 'PF':
                result = '建筑/房地产'
                break;
            case 'TR':
                result = '环保/公共设施'
                break;
            case 'ZS':
                result = '科研/技术服务'
                break;
            case 'IF':
                result = '农业'
                break;
            case 'JR':
                result = '医药/医疗/保健'
                break;
            case 'HS':
                result = '贸易/运输/物流'
                break;
            case 'ZL':
                result = '金融/投资'
                break;
            case 'SC':
                result = '零售/消费品'
                break;
            case 'JP':
                result = '教育/培训'
                break;
            case 'ED':
                result = '文化/体育/娱乐'
                break;
            case 'WS':
                result = 'IT/通讯/网络'
                break;
            case 'CU':
                result = '专业及商务服务'
                break;
            case 'PS':
                result = '政府/社会组织'
                break;
            case 'ET':
                result = '其他'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 业态类型 ---> 办公、车位、商铺、其他
    function businessType(state) {
        var result;
        switch (state) {
            case 'BG':
                result = '办公'
                break;
            case 'ST':
                result = '停车场'
                break;
            case 'WH':
                result = '库房'
                break;
            case 'AP':
                result = '公寓'
                break;
            case 'SP':
                result = '商铺'
                break;
            case 'ZZ':
                result = '住宅'
                break;
            case 'TWH':
                result = '临库'
                break;
            case 'AMP':
                result = '广告位'
                break;
            case 'ETC':
                result = '其他'
                break;
            case '办公':
                result = 'BG'
                break;
            case '车位':
                result = 'ST'
                break;
            case '商铺':
                result = 'SP'
                break;
            case '公寓':
                result = 'AP'
                break;
            case '库房':
                result = 'WH'
                break;
            case '住宅':
                result = 'ZZ'
                break;
            case '临库':
                result = 'TWH'
                break;
            case '广告位':
                result = 'AMP'
                break;
            case '其他':
                result = 'ETC'
                break;
            case 'WH':
                result = '库房'
                break;
            case 'AP':
                result = '公寓'
                break;
            case 'ZZ':
                result = '住宅'
                break;
            case 'TWH':
                result = '临库'
                break;
            case 'AMP':
                result = '广告位'
                break;

            case '库房':
                result = 'WH'
                break;
            case '公寓':
                result = 'AP'
                break;
            case '住宅':
                result = 'ZZ'
                break;
            case '临库':
                result = 'TWH'
                break;
            case '广告位':
                result = 'AMP'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 单元类型 ---> 普通、车位、工位
    function unitType(state) {
        var result;
        switch (state) {
            case 'BU':
                result = '普通单元'
                break;
            case 'ST':
                result = '停车场'
                break;
            case 'WP':
                result = '联合办公'
                break;
            case 'ST':
                result = '停车场'
                break;
            case '普通单元':
                result = 'BU'
                break;
            case '联合办公':
                result = 'WP'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 单元出租类型 ---> 自用、出租
    function rentType(state) {
        var result;
        switch (state) {
            case 'ZY':
                result = '自用'
                break;
            case 'RE':
                result = '出租'
                break;
            case '自用':
                result = 'ZY'
                break;
            case '出租':
                result = 'RE'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 账单模块
    // 账单支付方式 ---> 现金、微信、支付宝、银行转账、其他
    function billPayWay(state) {
        var result;
        switch (state) {
						case 'BD':
						  result = '银行汇票'
						  break;
						case 'BN':
						  result = '银行本票'
						  break;
						case 'CC':
						  result = '信用卡'
						  break;
            case 'XJ':
                result = '现金'
                break;
            case 'WX':
                result = '微信'
                break;
            case 'AP':
                result = '支付宝'
                break;
            case 'BK':
                result = '银行转账'
                break;
            case 'ZP':
                result = '支票'
                break;
            case 'ET':
                result = '其他'
                break;
            case '现金':
                result = 'XJ'
                break;
						case '银行汇票':
						  result = 'BD'
						  break;
						case '银行本票':
						  result = 'BN'
						  break;
						case '信用卡':
						  result = 'CC'
						  break;
            case '微信':
                result = 'WX'
                break;
            case '支付宝':
                result = 'AP'
                break;
            case '银行转账':
                result = 'BK'
                break;
            case '支票':
                result = 'ZP'
                break;
            case '其他':
                result = 'ET'
                break;
								
            default:
                result = ''
        }
        return result;
    }

    // 账单审核状态 ---> 待审核、已审核、审核拒绝、执行中、已到期、已作废
    function billAuditState(state) {
        var result;
        switch (state) {
            case 'WA':
                result = '待审核'
                break;
            case 'PA':
                result = '已审核'
                break;
            case 'RJ':
                result = '审核拒绝'
                break;
            case 'EX':
                result = '执行中'
                break;
            case 'FN':
                result = '已到期'
                break;
            case 'GC':
                result = '已作废'
                break;
            case '待审核':
                result = 'WA'
                break;
            case '已审核':
                result = 'PA'
                break;
            case '审核拒绝':
                result = 'RJ'
                break;
            case '执行中':
                result = 'EX'
                break;
            case '已到期':
                result = 'FN'
                break;
            case '已作废':
                result = 'GC'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 账单支付状态 ----> 未收、已支付、部分收款、待提交、待分配、完结、待收款、即将逾期、已逾期
    function billPaymentState(state) {
        var result;
        switch (state) {
            case 'WP':
                result = '未收'
                break;
            case 'APE':
                result = '已收'
                break;
            case 'PPE':
                result = '部分收款'
                break;
            case 'WTJ':
                result = '待提交'
                break;
            case 'WFP':
                result = '待分配'
                break;
            case 'FWJ':
                result = '完结'
                break;
            case 'WSK':
                result = '待收款'
                break;
            case 'DU':
                result = '即将到期'
                break;
            case 'OD':
                result = '已逾期'
                break;
			case 'WA':
			    result = '待审核'
			    break;
					case 'BWA':
					    result = '审批中'
					    break;
					case 'BRJ':
					    result = '审批拒绝'
					    break;
			case '审批中':
			    result = 'BWA'
			    break;
			case '审批拒绝':
			    result = 'BRJ'
			    break;
			case '待审核':
			    result = 'WA'
			    break;
            case '未付':
                result = 'WP'
                break;
            case '已支付':
                result = 'APE'
                break;
            case '部分支付':
                result = 'PPE'
                break;
            case '待提交':
                result = 'WTJ'
                break;
            case '待分配':
                result = 'WFP'
                break;
            case '完结':
                result = 'FWJ'
                break;
            case '待收款':
                result = 'WSK'
                break;
            case '即将到期':
                result = 'DU'
                break;
            case '已逾期':
                result = 'OD'
                break;
            default:
                result = ''

        }
        return result;
    }

    // 招商模块
    // 客户类型  ----->  公司、个人
    function customerType(state) {
        var result;
        switch (state) {
            case 'QY':
                result = '公司'
                break;
            case 'PE':
                result = '个人'
                break;
            case '公司':
                result = 'QY'
                break;
            case '个人':
                result = 'PE'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 客户获取渠道 ----> 上门、中介、老客户推荐、互联网、其他
    function customerChannelType(state) {
        var result;
        switch (state) {
            case 'SM':
                result = '上门'
                break;
            case 'ZJ':
                result = '中介'
                break;
            case 'TJ':
                result = '老客户推荐'
                break;
            case 'NT':
                result = '互联网'
                break;
            case 'NJ':
                result = '内部推荐'
                break;
            case 'ET':
                result = '其他'
                break;
            case '上门':
                result = 'SM'
                break;
            case '中介':
                result = 'ZJ'
                break;
            case '老客户推荐':
                result = 'TJ'
                break;
            case '互联网':
                result = 'NT'
                break;
            case '内部推荐':
                result = 'NJ'
                break;
            case '其他':
                result = 'ET'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 客户状态  ----> 潜在客户、意向客户、流失客户、成交客户
    function customerState(state) {
        var result;
        switch (state) {
            case 'PO':
                result = '潜在客户'
                break;
            case 'YX':
                result = '意向客户'
                break;
            case 'LS':
                result = '流失客户'
                break;
            case 'CJ':
                result = '成交客户'
                break;
            case 'BC':
                result = '黑名单客户'
                break;
            case '潜在客户':
                result = 'PO'
                break;
            case '意向客户':
                result = 'YX'
                break;
            case '流失客户':
                result = 'LS'
                break;
            case '成交客户':
                result = 'CJ'
                break;
            case '黑名单客户':
                result = 'BC'
                break;
            default:
                result = ''
        }
        return result;
    }

    //设施类型  --->  LB拎包入住、YX有线电视、WX无线电视、YY饮用水、KT空调、DY打印机、CZ传真、FY24小时、DW独立卫生间、TQ天然气、YD烟道、SX上下水
    function facilitys(state) {
        var result;
        switch (state) {
            case 'LB':
                result = '拎包入住'
                break;
            case 'YX':
                result = '有线电视'
                break;
            case 'WX':
                result = '无线电视'
                break;
            case 'YY':
                result = '饮用水'
                break;
            case 'KT':
                result = '空调'
                break;
            case 'DY':
                result = '打印机'
                break;
            case 'CZ':
                result = '传真'
                break;
            case 'FY':
                result = "24小时热水"
                break;
            case 'DW':
                result = '独立卫生间'
                break;
            case 'TQ':
                result = '天然气'
                break;
            case 'YD':
                result = '烟道'
                break;
            case 'SX':
                result = '上下水'
                break;
            case "CF":
                result = "厨房"
                break;
            default:
                result = ''
        }
        return result;
    }

    // 装修水平  ---> 毛坯、简修、豪装、精装、拎包入住
    function decoration(state) {
        var result;
        switch (state) {
            case "MP":
                result = '毛坯'
                break;
            case "SD":
                result = "简修"
                break;
            case "HD":
                result = "豪装"
                break;
            case "JD":
                result = "精装"
                break;
            case "LD":
                result = "拎包入住"
                break;
            case "ET":
                result = '其他'
                break;

            case "毛坯":
                result = 'MP'
                break;
            case "简修":
                result = "SD"
                break;
            case "豪装":
                result = "HD"
                break;
            case "精装":
                result = "JD"
                break;
            case "拎包入住":
                result = "LD"
                break;
            case "其他":
                result = 'ET'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 朝向 ---> 东、南 、西 、北 、东南 、东北 、西南 、西北 、其他
    function orientation(state) {
        var result;
        switch (state) {
            case "E":
                result = "东"
                break;
            case "S":
                result = "南"
                break;
            case "W":
                result = "西"
                break;
            case "N":
                result = "北"
                break;
            case "ES":
                result = "东南"
                break;
            case "EN":
                result = "东北"
                break;
            case "WS":
                result = "西南"
                break;
            case "WN":
                result = "西北"
                break;
            case "ET":
                result = "其他"
                break;

            case "东":
                result = "E"
                break;
            case "南":
                result = "S"
                break;
            case "西":
                result = "W"
                break;
            case "北":
                result = "N"
                break;
            case "东南":
                result = "ES"
                break;
            case "东北":
                result = "EN"
                break;
            case "西北":
                result = "WN"
                break;
            case "其他":
                result = "ET"
                break;
            default:
                result = ''
        }
        return result;
    }

    // 线索客户跟进类型  ---> 客户上门、主动拜访、客户来电、主动电访、短信、微信、邮件、其他
    function businessFollowUpType(state) {
        var result;
        switch (state) {
            case "KHSM":
                result = '客户上门'
                break;
            case "ZDBF":
                result = "主动拜访"
                break;
            case "KHLD":
                result = "客户来电"
                break;
            case "ZDDF":
                result = "主动电访"
                break;
            case "SMS":
                result = "短信"
                break;
            case "WECHAT":
                result = '微信'
                break;
            case "MAIL":
                result = '邮件'
                break;
            case "OTHER":
                result = '其他'
                break;

            case "客户上门":
                result = 'KHSM'
                break;
            case "主动拜访":
                result = "ZDBF"
                break;
            case "客户来电":
                result = "KHLD"
                break;
            case "主动电访":
                result = "ZDDF"
                break;
            case "短信":
                result = "SMS"
                break;
            case "微信":
                result = 'WECHAT'
                break;
            case "邮件":
                result = 'MAIL'
                break;
            case "其他":
                result = 'OTHER'
                break;
            default:
                result = ''
        }
        return result;
    }

    // 线索客户跟进意向水平  ---> 一般、无、未知、强烈
    function businessFollowIntentLevel(state) {
        var result;
        switch (state) {
            case "YB":
                result = '一般'
                break;
            case "NONE":
                result = "无"
                break;
            case "NA":
                result = "未知"
                break;
            case "QL":
                result = "强烈"
                break;

            case "一般":
                result = 'YB'
                break;
            case "无":
                result = "NONE"
                break;
            case "未知":
                result = "NA"
                break;
            case "强烈":
                result = "QL"
                break;
            default:
                result = ''
        }
        return result;
    }

    return {
        // 单元朝向
        orientation: function(state) {
            return orientation(state)
        },
        // 配套基础设施
        facilitys: function(state) {
            return facilitys(state)
        },
        // 装修水平
        decoration: function(state) {
            return decoration(state)
        },
        // 费项种类
        costType: function(state) {
            return costType(state)
        },
        // 产业类型
        industryType: function(state) {
            return industryType(state)
        },
        // 押付方式
        depositType: function(state) {
            return depositType(state)
        },
        // 合同类型
        contractType: function(state) {
            return contractType(state)
        },
        contractZlfType: function(state) {
            return contractZlfType(state)
        },
        // 合同审核状态
        contractAuditState: function(state) {
            return contractAuditState(state)
        },
        // 业态类型
        businessType: function(state) {
            return businessType(state)
        },
        // 单元类型
        unitType: function(state) {
            return unitType(state)
        },
        // 出租类型
        rentType: function(state) {
            return rentType(state)
        },
        // 账单支付方式
        billPayWay: function(state) {
            return billPayWay(state)
        },
        // 账单审核状态
        billAuditState: function(state) {
            return billAuditState(state)
        },
        // 账单支付状态
        billPaymentState: function(state) {
            return billPaymentState(state)
        },
        // 招商客户类型
        customerType: function(state) {
            return customerType(state)
        },
        // 招商客户获取渠道
        customerChannelType: function(state) {
            return customerChannelType(state)
        },
        // 招商客户状态
        customerState: function(state) {
            return customerState(state)
        },
        // 退租审核状态
        withdrawAuditState: function(state) {
            return withdrawAuditState(state)
        },
        // 线索客户跟进类型
        businessFollowUpType: function(state) {
            return businessFollowUpType(state)
        },
        // 线索客户跟进意向水平
        businessFollowIntentLevel: function(state) {
            return businessFollowIntentLevel(state)
        }
    }
})()
